home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
util
/
cdity
/
availmem2.lha
/
AvailMem2
/
src
/
AvailMem2_resize.s
< prev
next >
Wrap
Text File
|
1997-07-01
|
2KB
|
104 lines
machine 68020
* program includes
include "AvailMem2_gui.i"
include "AvailMem2.i"
include "lvo.i"
incdir "include:"
include "exec/exec.i"
include "exec/funcdef.i"
include "intuition/intuition.i"
section code,code ;availmem code section
_HandleResizeMsgs
* * * * * * * * * * * * * * * * * * * * *
* *
* Handles resize window msgs. *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d0-a6,-(sp) ;push all registers
clr.l .prg_ResizeClose ;reset window close variable
tst.l ResizeWnd ;check if resize window open
beq .no_ResizeWnd ;skip if not
.MsgLoop_Resize
move.l _GadToolsBase,a6 ;put gadtoolsbase in a6
move.l ResizeWnd,a0 ;get ptr to resize window
move.l wd_UserPort(a0),a0 ;get window userport
jsr _LVOGT_GetIMsg(a6) ;get any waiting message
move.l d0,ptr_TempMsg ;store msg
beq .no_ResizeWnd ;if no message, continue looping
move.l ptr_TempMsg,a4 ;put msg in a4
move.l im_Class(a4),d4 ;get msg class
cmp.l #IDCMP_CHANGEWINDOW,d4 ;check if window is changed
bne .not_IDCMP_CHANGEWINDOW ;skip if not
move.l ResizeWnd,a0 ;put ptr to resize window in a0
* refresh window pos and size
move.w wd_LeftEdge(a0),ResizeLeft
move.w wd_TopEdge(a0),ResizeTop
move.w wd_Width(a0),ResizeWidth
move.w wd_Height(a0),d0
move.b wd_BorderTop(a0),d1
ext.w d1
sub.w d1,d0
move.w d0,ResizeHeight
clr.l d4
.not_IDCMP_CHANGEWINDOW
cmp.l #IDCMP_CLOSEWINDOW,d4 ;check if closegadget was pressed
bne .not_IDCMP_CLOSEWINDOW ;skip if not
st.l .prg_ResizeClose ;set window close variable
move.w ResizeLeft,MemoryDisplayLeft
move.w ResizeTop,MemoryDisplayTop
move.w ResizeWidth,MemoryDisplayWidth
move.w ResizeHeight,MemoryDisplayHeight
clr.l d4 ;reset msg class
.not_IDCMP_CLOSEWINDOW
move.l _GadToolsBase,a6 ;put gadtoolsbase in a6
move.l ptr_TempMsg,a1 ;put tempmsg in a1
jsr _LVOGT_ReplyIMsg(a6) ;reply window msg
bra .MsgLoop_Resize ;loop message-reader
.no_ResizeWnd
tst.l .prg_ResizeClose ;check if win should close
beq .no_ResizeClose ;skip if it shouldn't
jsr _CloseGUI ;close program GUI
jsr _OpenGUI ;reopen program GUI
tst.l d0 ;check if everything went ok
beq .Fail ;bail out if failure
.no_ResizeClose
movem.l (sp)+,d0-a6 ;pop all registers
clr.l d0 ;set exitcode to FALSE
rts ;return
.Fail
movem.l (sp)+,d0-a6 ;pop all registers
st.l d0 ;set exitcode to TRUE
rts ;return
.prg_ResizeClose ds.l 1